package com.visceb.backstage.dao;
import com.visceb.backstage.entity.email;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.time.LocalDate;
import java.util.List;

public interface emailRepository extends JpaRepository<email, Long> {

    List<email> findAllBySubjectLike(String subject);
    @Query(nativeQuery = true,value =
            "select * from email where  subject like '%?1%'")
//            "select * from email where DATA >= ?2 and DATA < ?3 and subject like '%?1%'")
//    "select * from email where (DATA >= :?2 and DATA < :?3)")
    List<email> findAllByWordsLike(String word,LocalDate startTime, LocalDate endTime);
    List<email> findByTime(String time);
}
